package clientClasses;

import java.util.concurrent.ConcurrentLinkedQueue;

public class Orders {

    //private static Orders instance = null;
    private ConcurrentLinkedQueue<InfoCarier> orders = new ConcurrentLinkedQueue<InfoCarier>();

    public synchronized boolean isEmpty() {
        return orders.isEmpty();
    }

    public synchronized InfoCarier getOrder() {
        return orders.remove();
    }

    public synchronized InfoCarier.infoTypeEnum firstOrderType() {
        return orders.peek().getInfoType();
    }

    public synchronized void add(InfoCarier ic) {
        orders.add(ic);
    }
}
